import { defineStore } from "pinia";
import type { Order } from "@/service/api/types/reservation";

type ReservationStore = {
    unpaidOrder: Order | null;
};

const useReservationStore = defineStore("reservation", {
    state: (): ReservationStore => ({
        unpaidOrder: null,
    }),
    getters: {
        getUnpaidOrder: (state) => state.unpaidOrder,
    },
    actions: {
        setUnpaidOrder(order: Order | null) {
            this.unpaidOrder = order;
        },
    },
});

export default useReservationStore;
